package com.sky.context;

/**
 * 线程的上下文环境
 */
public class BaseContext {
    // 本地线程--当前线程， 每次开启线程的时候创建，现场销毁后，本对象也就销毁
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
